function [theta_est] = DoA(data_IFFT_MTI,subcSpacing,fc,AntSpace,MaxIndexDist,velo_Est)
    [~,sym_Num,ant_Num] = size(data_IFFT_MTI);
    data_Subc = squeeze(data_IFFT_MTI(MaxIndexDist,:,:));
    % 频偏补偿
    fd = 2*velo_Est*fc/3e8;
    t = [0:1/subcSpacing:(sym_Num-1)/subcSpacing];
    deltaF = exp(1j*2*pi*fd*t).';
    data_Compensation = zeros(sym_Num,ant_Num);
    for i_ant = 1:ant_Num
        data_Compensation(:,i_ant) = data_Subc(:,i_ant).*deltaF;
    end
    % 符号合并--最大比合并
    P_Sum = sum(abs(data_Compensation).^2,2);
    weights = P_Sum./sum(P_Sum);
    for i_sym = 1:sym_Num
        data_sym(i_sym,:)=data_Compensation(i_sym,:)*weights(i_sym);
    end
    data = sum(data_sym).'/sym_Num;
    % 扫描到达角
    R = (data*data');          
    theta_grid = linspace(-90,90,180);
    P_Scan = zeros(length(theta_grid),1);
    for i_theta = 1:length(theta_grid)
        theta = theta_grid(i_theta);
        a_x = exp(-1j*2*pi*(0:ant_Num-1)'*AntSpace*sind(theta));
        P_Scan(i_theta) = abs(a_x'*R*a_x);
    end
    [~,idx] = max(P_Scan);
    theta_est = theta_grid(idx);
    figure;
    plot(theta_grid,P_Scan);
    title('均匀线阵 (ULA) 波束扫描 DOA 估计');
    xlabel('角度 (°)');
    ylabel('波束扫描功率');
end